<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>08-上下margin折叠_02-父子元素</title>
    <style>
        .div1 {
            width: 200px;
            height: 200px;
            background-color: #f00;
            margin-top: 60px;
        }

        .div2 {
            width: 100px;
            height: 100px;
            background-color: #0f0;
            margin-top: 40px;
        }
    </style>
</head>
<body>

<div class="div1">
    <div class="div2"></div>
</div>

</body>
</html>